/*!
 * SPDX-License-Identifier: Apache-2.0
 *
 * The OpenSearch Contributors require contributions made to
 * this file be licensed under the Apache-2.0 license or a
 * compatible open source license.
 *
 * Modifications Copyright OpenSearch Contributors. See
 * GitHub history for details.
 */

// Sizing
$ouiFormMaxWidth: $ouiSizeXXL * 10 !default;
$ouiFormControlHeight: $ouiSizeXXL !default;
$ouiFormControlCompressedHeight: $ouiSizeXL !default;
$ouiFormControlPadding: $ouiSizeM !default;
$ouiFormControlCompressedPadding: $ouiSizeS !default;
$ouiFormControlBorderRadius: 0 !default;
$ouiFormControlCompressedBorderRadius: $ouiBorderRadiusSmall !default;

$ouiRadioSize: $ouiSize !default;
$ouiCheckBoxSize: $ouiSize !default;
$ouiCheckboxBorderRadius: $ouiBorderRadius !default;

// Switch
$ouiSwitchHeight: $ouiSize * 1.25 !default;
$ouiSwitchWidth: ($ouiSize * 2.5) + $ouiSizeXS !default;
$ouiSwitchThumbSize: $ouiSwitchHeight !default;
$ouiSwitchIconHeight: $ouiSize !default;

$ouiSwitchHeightCompressed: $ouiSize !default;
$ouiSwitchWidthCompressed: $ouiSize * 1.75 !default;
$ouiSwitchThumbSizeCompressed: $ouiSwitchHeightCompressed !default;

$ouiSwitchHeightMini: $ouiSwitchHeight * .5 !default;
$ouiSwitchWidthMini: $ouiSwitchWidth * .5 !default;
$ouiSwitchThumbSizeMini: $ouiSwitchHeightMini !default;

// Modifier naming and colors.
$ouiSwitchColors: (
  primary: $ouiColorPrimary,
  accent: $ouiColorAccent,
  secondary: $ouiColorSecondary,
  success: $ouiColorSuccess,
  warning: $ouiColorWarning,
  danger: $ouiColorDanger,
  subdued: $ouiTextSubduedColor, // Should get deprecated in favor of `text`
  ghost: $ouiColorGhost, // Ghost is special, and does not care about theming.
  text: $ouiColorDarkShade, // Reserved for special use cases
) !default;

// Coloring
$ouiFormBackgroundColor: tintOrShade($ouiColorLightestShade, 60%, 40%) !default;
$ouiFormBackgroundDisabledColor: darken($ouiColorLightestShade, 2%) !default;
$ouiFormBackgroundReadOnlyColor: transparentize(lightOrDarkTheme($ouiColorLightShade, $ouiColorInk), .95) !default;
$ouiFormBorderOpaqueColor: shadeOrTint(desaturate(adjust-hue($ouiColorPrimary, 22), 22.95), 26%, 100%) !default;
$ouiFormBorderColor: transparentize($ouiFormBorderOpaqueColor, .9) !default;
$ouiFormBorderDisabledColor: transparentize($ouiFormBorderOpaqueColor, .9) !default;
$ouiFormCustomControlDisabledIconColor: shadeOrTint($ouiColorMediumShade, 38%, 48.5%) !default; // exact 508c foreground for $ouiColorLightShade
$ouiFormCustomControlBorderColor: shadeOrTint($ouiColorLightestShade, 18%, 30%) !default;
$ouiFormControlDisabledColor: $ouiColorMediumShade !default;
$ouiFormControlBoxShadow: 0 1px 1px -1px transparentize($ouiShadowColor, .8), 0 3px 2px -2px transparentize($ouiShadowColor, .8) !default;
$ouiFormControlPlaceholderText: makeHighContrastColor($ouiTextSubduedColor, $ouiFormBackgroundColor) !default;
$ouiFormInputGroupLabelBackground: tintOrShade($ouiColorLightShade, 50%, 40%) !default;
$ouiFormInputGroupBorder: 1px solid shadeOrTint($ouiFormInputGroupLabelBackground, 2%, 4%) !default;
$ouiSwitchOffColor: lightOrDarkTheme(transparentize($ouiColorMediumShade, .8), transparentize($ouiColorMediumShade, .3)) !default;

// Control Layout
$ouiFormControlLayoutGroupInputHeight: $ouiFormControlHeight - 2px !default;
$ouiFormControlLayoutGroupInputCompressedHeight: $ouiFormControlCompressedHeight - 2px !default;
$ouiFormControlLayoutGroupInputCompressedBorderRadius: calc($ouiFormControlCompressedBorderRadius / 2) !default;

// Range
$ouiRangeTrackColor: $ouiColorDarkShade !default;

$ouiRangeThumbRadius: 50% !default;
$ouiRangeThumbHeight: $ouiSize !default;
$ouiRangeThumbWidth: $ouiSize !default;
$ouiRangeThumbBorderColor: $ouiRangeTrackColor !default;

$ouiRangeTrackWidth: 100% !default;
$ouiRangeTrackHeight: 2px !default;
$ouiRangeTrackBorderWidth: 0px !default;
$ouiRangeTrackBorderColor: $ouiRangeTrackColor !default;
$ouiRangeTrackRadius: $ouiBorderRadius !default;

$ouiRangeDisabledOpacity: .25 !default;

$ouiRangeHighlightHeight: $ouiSizeXS !default;


/* OUI -> EUI Aliases */
$euiFormMaxWidth: $ouiFormMaxWidth;
$euiFormControlHeight: $ouiFormControlHeight;
$euiFormControlCompressedHeight: $ouiFormControlCompressedHeight;
$euiFormControlPadding: $ouiFormControlPadding;
$euiFormControlCompressedPadding: $ouiFormControlCompressedPadding;
$euiFormControlBorderRadius: $ouiFormControlBorderRadius;
$euiFormControlCompressedBorderRadius: $ouiFormControlCompressedBorderRadius;
$euiRadioSize: $ouiRadioSize;
$euiCheckBoxSize: $ouiCheckBoxSize;
$euiCheckboxBorderRadius: $ouiCheckboxBorderRadius;
$euiSwitchHeight: $ouiSwitchHeight;
$euiSwitchWidth: $ouiSwitchWidth;
$euiSwitchThumbSize: $ouiSwitchThumbSize;
$euiSwitchIconHeight: $ouiSwitchIconHeight;
$euiSwitchHeightCompressed: $ouiSwitchHeightCompressed;
$euiSwitchWidthCompressed: $ouiSwitchWidthCompressed;
$euiSwitchThumbSizeCompressed: $ouiSwitchThumbSizeCompressed;
$euiSwitchHeightMini: $ouiSwitchHeightMini;
$euiSwitchWidthMini: $ouiSwitchWidthMini;
$euiSwitchThumbSizeMini: $ouiSwitchThumbSizeMini;
$euiSwitchColors: $ouiSwitchColors;
$euiFormBackgroundColor: $ouiFormBackgroundColor;
$euiFormBackgroundDisabledColor: $ouiFormBackgroundDisabledColor;
$euiFormBackgroundReadOnlyColor: $ouiFormBackgroundReadOnlyColor;
$euiFormBorderOpaqueColor: $ouiFormBorderOpaqueColor;
$euiFormBorderColor: $ouiFormBorderColor;
$euiFormBorderDisabledColor: $ouiFormBorderDisabledColor;
$euiFormCustomControlDisabledIconColor: $ouiFormCustomControlDisabledIconColor;
$euiFormCustomControlBorderColor: $ouiFormCustomControlBorderColor;
$euiFormControlDisabledColor: $ouiFormControlDisabledColor;
$euiFormControlBoxShadow: $ouiFormControlBoxShadow;
$euiFormControlPlaceholderText: $ouiFormControlPlaceholderText;
$euiFormInputGroupLabelBackground: $ouiFormInputGroupLabelBackground;
$euiFormInputGroupBorder: $ouiFormInputGroupBorder;
$euiSwitchOffColor: $ouiSwitchOffColor;
$euiFormControlLayoutGroupInputHeight: $ouiFormControlLayoutGroupInputHeight;
$euiFormControlLayoutGroupInputCompressedHeight: $ouiFormControlLayoutGroupInputCompressedHeight;
$euiFormControlLayoutGroupInputCompressedBorderRadius: $ouiFormControlLayoutGroupInputCompressedBorderRadius;
$euiRangeTrackColor: $ouiRangeTrackColor;
$euiRangeThumbRadius: $ouiRangeThumbRadius;
$euiRangeThumbHeight: $ouiRangeThumbHeight;
$euiRangeThumbWidth: $ouiRangeThumbWidth;
$euiRangeThumbBorderColor: $ouiRangeThumbBorderColor;
$euiRangeTrackWidth: $ouiRangeTrackWidth;
$euiRangeTrackHeight: $ouiRangeTrackHeight;
$euiRangeTrackBorderWidth: $ouiRangeTrackBorderWidth;
$euiRangeTrackBorderColor: $ouiRangeTrackBorderColor;
$euiRangeTrackRadius: $ouiRangeTrackRadius;
$euiRangeDisabledOpacity: $ouiRangeDisabledOpacity;
$euiRangeHighlightHeight: $ouiRangeHighlightHeight;
/* End of Aliases */
